﻿// Interactive encapsulates the interaction with the browser
define([
'Xjs/core/util',
'Xjs/core/Highlightable',
'Xjs/core/Selectable',
'Xjs/core/ContextMenuHolder'
],
function (util, Highlightable, Selectable, ContextMenuHolder) {
    'use strict';

    var type = 'interactive',
    Interactive = Xjs.getType(type);

    if (Interactive) { // It has been already loaded
        return Interactive;
    }

    // Base interactive. It features id generation, type and instance registration
    Interactive = util.define({
        mixins: [
            Highlightable,
            Selectable,
            ContextMenuHolder
        ],

        initialize: function (conf, parent) {

            Highlightable.prototype.initialize.call(this, conf);
            Selectable.prototype.initialize.call(this, conf);
            ContextMenuHolder.prototype.initialize.call(this, conf);
        },      

        // The type of the interactive
        type: type
    });

    Xjs.registerType(Interactive);

    return Interactive;
});